//
//  XBXJ_RealSingletonVC.swift
//  APSwift
//
//  Created by jianbo.pei on 2022/11/25.
//

import UIKit

class XBXJ_RealSingletonVC: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        test_sub_NSObject()
        test_unsub_NSObject()
    }
    
    //MARK: 继承自`NSObject`的的单例
    private func test_sub_NSObject() {
        let easyNSObjectManager_shared = XBXJ_Easy_NSObject_Manager.shared
//        let easyNSObjectManager_shared_Copy = easyNSObjectManager_shared.copy()
//        let easyNSObjectManager_shared_mutCopy = easyNSObjectManager_shared.mutableCopy()
        
        debugPrint("easyNSObjectManager_shared is         \(easyNSObjectManager_shared)")
//        debugPrint("easyNSObjectManager_shared_Copy is    \(easyNSObjectManager_shared_Copy)")
//        debugPrint("easyNSObjectManager_shared_mutCopy is \(easyNSObjectManager_shared_mutCopy)")
        
        let easyNSObjectManager_init = XBXJ_Easy_NSObject_Manager()
//        let easyNSObjectManager_init_Copy = easyNSObjectManager_init.copy()
//        let easyNSObjectManager_init_mutCopy = easyNSObjectManager_init.mutableCopy()
        
        debugPrint("easyNSObjectManager_init is         \(easyNSObjectManager_init)")
//        debugPrint("easyNSObjectManager_init_Copy is    \(easyNSObjectManager_init_Copy)")
//        debugPrint("easyNSObjectManager_init_mutCopy is \(easyNSObjectManager_init_mutCopy)")

        
        
        let realNSObjectManager_shared = XBXJ_Real_NSObject_Manager.shared
        let realNSObjectManager_shared_Copy = realNSObjectManager_shared.copy()
        let realNSObjectManager_shared_mutCopy = realNSObjectManager_shared.mutableCopy()
        debugPrint("realNSObjectManager_shared is         \(realNSObjectManager_shared)")
        debugPrint("realNSObjectManager_shared_Copy is    \(realNSObjectManager_shared_Copy)")
        debugPrint("realNSObjectManager_shared_mutCopy is \(realNSObjectManager_shared_mutCopy)")

    }
    
    //MARK: 不继承自`NSObject`的的单例
    private func test_unsub_NSObject() {
        /// 具体参考上面的示例即可
    }

}
